<template>
  <div>
    test
  </div>
</template>
<script>
const createWorker = function (f) {
  const blob = new Blob(['(' + f.toString() + ')()']);
  const url = window.URL.createObjectURL(blob);
  const worker = new Worker(url);
  return worker;
}
export default {
  components: {},
  props: {
  },
  data() {
    return {
    }
  },
  computed: {
  },
  methods: {
  },
  created() {
  },
  mounted() {
    this.worker = createWorker(function (e) {
      setTimeout(() => {
        self.postMessage('A')
      }, 1000)
      
    })
    this.worker.addEventListener('message', (e) => {
      // postMessage('some message');
      console.log('e.data', e.data)
    }, false);
  }
}
</script>
<style lang="scss" scoped>
</style>)